﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace debioscoopincdrie.Managers
{
    class DatabaseManager
    {
        #region Fields
        private static DatabaseManager INSTANCE;

        private debioscoopEntities db;
        #endregion

        #region Constructors
        private DatabaseManager()
        {
            db = new debioscoopEntities();
        }
        #endregion

        #region Static functions
        public static DatabaseManager GetManager()
        {
            if (INSTANCE == null)
            {
                INSTANCE = new DatabaseManager();
            }

            return INSTANCE;
        }
        #endregion

        #region functions
        public debioscoopEntities GetEntities()
        {
            return db;
        }

        public void SaveChanges()
        {
            GetEntities().SaveChanges();
        }
        #endregion
    }
}
